home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / gnugo1_1.lha / gnugo / sethand.c < prev    next >
C/C++ Source or Header  |  1989-03-07  |  2KB  |  105 lines

  1. /*
  2.                 GNU GO - the game of Go (Wei-Chi)
  3.                 Version 1.1   last revised 3-1-89
  4.            Copyright (C) Free Software Foundation, Inc.
  5.                       written by Man L. Li
  6.                       modified by Wayne Iba
  7.                     documented by Bob Webber
  8. */
  9. /*
  10. This program is free software; you can redistribute it and/or modify
  11. it under the terms of the GNU General Public License as published by
  12. the Free Software Foundation - version 1.
  13.  
  14. This program is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. GNU General Public License in file COPYING for more details.
  18.  
  19. You should have received a copy of the GNU General Public License
  20. along with this program; if not, write to the Free Software
  21. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22.  
  23. Please report any bug/fix, modification, suggestion to
  24.  
  25. mail address:   Man L. Li
  26.                 Dept. of Computer Science
  27.                 University of Houston
  28.                 4800 Calhoun Road
  29.                 Houston, TX 77004
  30.  
  31. e-mail address: manli@cs.uh.edu         (Internet)
  32.                 coscgbn@uhvax1.bitnet   (BITNET)
  33.                 70070,404               (CompuServe)
  34. */
  35.  
  36. #include <stdio.h>
  37.  
  38. #define BLACK 2
  39.  
  40. extern unsigned char p[19][19];
  41.  
  42. sethand(i)
  43. /* set up handicap pieces */
  44. int i;
  45.  
  46. {
  47.  if (i > 0)
  48.    {
  49.     p[3][3] = BLACK;
  50.     if (i > 1)
  51.       {
  52.        p[15][15] = BLACK;
  53.        if (i > 2)
  54.      {
  55.       p[3][15] = BLACK;
  56.       if (i > 3)
  57.         {
  58.          p[15][3] = BLACK;
  59.          if (i == 5)
  60.         p[9][9] = BLACK;
  61.          else
  62.         if (i > 5)
  63.           {
  64.            p[9][15] = BLACK;
  65.            p[9][3] = BLACK;
  66.            if (i == 7)
  67.               p[9][9] = BLACK;
  68.            else
  69.               if (i > 7)
  70.             {
  71.              p[15][9] = BLACK;
  72.              p[3][9] = BLACK;
  73.              if (i > 8)
  74.              p[9][9] = BLACK;
  75.               if (i > 9)
  76.                 {p[2][2] = 2;
  77.                  if (i > 10)
  78.                    {p[16][16] = 2;
  79.                     if (i > 11)
  80.                   {p[2][16] = 2;
  81.                    if (i > 12)
  82.                      {p[16][2] = 2;
  83.                       if (i > 13)
  84.                         {p[6][6] = 2;
  85.                      if (i > 14)
  86.                        {p[12][12] = 2;
  87.                         if (i > 15)
  88.                           {p[6][12] = 2;
  89.                            if (i > 16)
  90.                          p[12][6] = 2;
  91.                          }
  92.                       }
  93.                        }
  94.                     }
  95.                  }
  96.                   }
  97.                }
  98.                }
  99.          }
  100.        }
  101.     }
  102.      }
  103.   }
  104. }  /* end sethand */
  105.